package com.baoleme.entity;


import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

/**
 * <p>
 *
 * </p>
 *
 * @author wuyunbin
 * @since 2024-09-25
 */
@Data

public class ShoppingCart implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;

    @NotNull(message = "菜品名称不能为空")
    private String name;

    @NotNull(message = "图片不能为空")
    private String image;

    @NotNull(message = "用户id不能为空")
    private String memberId;


    private String goodsId;

    private String setMealId;

    @NotNull(message = "菜品口味不能为空")
    private String goodsFlavor;

    @Range(min = 1,message = "菜品数量不能小于1")
    private Integer number;

    @Range(min = 0,message = "菜品金额不能小于0")
    private BigDecimal amount;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
}
